package com.chixing.day05;

public class Account {
        public  long accNo;
        public String accName;
        private long accTelno;
        private long accPassword;
        private String  accEmail;
        private double accBalance;
        private int accType;

        public Account(){

}
        public Account(long no, String name, long tel, long pwd, String email, double bal, int type){

            this.accNo=no;
            this.accName=name;
            this.accTelno=tel;
            this.accPassword=pwd;
            this.accEmail=email;
            this.accBalance=bal;
            this.accType=type;


        }

        //存款
        public double depoist(double money){
            this.accBalance += money;
            return this.accBalance;
        }

        //取款
        public double withdraw(double money){
            this.accBalance -= money;
            return this.accBalance;
        }

    public long getAccNo() {
        return accNo;
    }

    public void setAccNo(long accNo) {
        this.accNo = accNo;
    }

    public String getAccName() {
        return accName;
    }

    public void setAccName(String accName) {
        this.accName = accName;
    }

    public long getAccTelno() {
        return accTelno;
    }

    public void setAccTelno(long accTelno) {
        this.accTelno = accTelno;
    }

    public long getAccPassword() {
        return accPassword;
    }

    public void setAccPassword(long accPassword) {
        this.accPassword = accPassword;
    }

    public String getAccEmail() {
        return accEmail;
    }

    public void setAccEmail(String accEmail) {
        this.accEmail = accEmail;
    }

    public double getAccBalance() {
        return accBalance;
    }

    public void setAccBalance(double accBalance) {
        this.accBalance = accBalance;
    }

    public int getAccType() {
        return accType;
    }

    public void setAccType(int accType) {
        this.accType = accType;
    }

//    alt+insert tostring()
    @Override
    public String toString() {
        return "Account{" +
                "accNo=" + accNo +
                ", accName='" + accName + '\'' +
                ", accTelno=" + accTelno +
                ", accPassword=" + accPassword +
                ", accEmail='" + accEmail + '\'' +
                ", accBalance=" + accBalance +
                ", accType=" + accType +
                '}';
    }
}
